package com.gwt.tirso.gymkhana.shared;

import com.google.gwt.user.client.Random;

public class IdGenerator {
    private static IdGenerator guidgen;
    private int random;

    private IdGenerator() {
        this.random =  new Integer(0);
    }

    public static synchronized IdGenerator getInstance() {
        if (guidgen == null) {
            guidgen = new IdGenerator();
        }
        return guidgen;
    }

    public String getKey() {
    	random =  Random.nextInt();
        String key = "" + System.currentTimeMillis() + Long.toHexString(random);
        return key;
    }
}